import request from '@/utils/request'

// 查询加分项列表
export function listItem(query) {
  return request({
    url: '/system/item/list',
    method: 'get',
    params: query
  })
}

// 查询加分项详细
export function getItem(plusGradeItemId) {
  return request({
    url: '/system/item/' + plusGradeItemId,
    method: 'get'
  })
}

// 新增加分项
export function addItem(data) {
  return request({
    url: '/system/item',
    method: 'post',
    data: data
  })
}

// 修改加分项
export function updateItem(data) {
  return request({
    url: '/system/item',
    method: 'put',
    data: data
  })
}

// 删除加分项
export function delItem(plusGradeItemId) {
  return request({
    url: '/system/item/' + plusGradeItemId,
    method: 'delete'
  })
}

// 导出加分项
export function exportItem(query) {
  return request({
    url: '/system/item/export',
    method: 'get',
    params: query
  })
}

// 导出加分项
export function getListAllTypeAndData() {
  return request({
    url: 'system/type/getListAllTypeAndData',
    method: 'get',
  })
}


//异步算分机制
export function calculate(userId) {
  const query = {
    userId
  };
  return request({
    url: '/system/item/calculate',
    method: 'get',
    params: query
  })
}
